package com.eims.sls_app.ui;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;

import bls.juejin.cn.R;
import com.eims.sls_app.dataaccess.Schemes;
import com.eims.sls_app.ui.adapter.MyFollowNumberAdapter;

public class FollowNumberActivity extends MyBaseActivity {

	private ListView listView;
	private MyFollowNumberAdapter fAdapter;
	private Bundle bundle;
	private String[] list_number;
	private Schemes scheme;
	private TextView tv_touzhu;// 显示注数
	private ImageButton btn_back;// 返回

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// 设置无标题
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_follow_number_notjc);
		init();
		findView();
		setListener();

	}

	/** 初始化 */
	private void init() {
		bundle = getIntent().getBundleExtra("bundle");
		scheme = (Schemes) bundle.getSerializable("schem");
		list_number = scheme.getLotteryNumber().split("\\n");
	}

	/** 初始化UI */
	private void findView() {
		tv_touzhu = (TextView) this.findViewById(R.id.tv_touzhu);
		btn_back = (ImageButton) this.findViewById(R.id.btn_back);
		tv_touzhu.setText("投注（" + scheme.getCountNotes() + "注）");
		listView = (ListView) this.findViewById(R.id.followinfo_jc_listView);
		fAdapter = new MyFollowNumberAdapter(this, scheme.getBuyContent(),
				scheme.getMultiple());
	}

	private void setListener() {
		btn_back.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				FollowNumberActivity.this.finish();
			}
		});
		listView.setAdapter(fAdapter);
	}

}
